<html>
<head>
<title>Element</title>
<script type="text/javascript"> 
  window.onload = function() { 
    document.getElementById('testButton').onclick = function() { 
      document.getElementById('abc').style.color = 'red'; 
    }; 
  }; 
</script>
</head>
<body>

<lable id="xyz">Hello JavaScript</label>

<button 
  type="button" 
  onclick="document.getElementById('xyz').style.color='red';"> 
    Click Me 
</button>

<br/><br/>

<lable id="abc">Hello JavaScript</label>

<button type="button" id="testButton">Click Me</button> 

</body>